package concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 捕获异常
 *
 * 2018年 09月 25日 星期二
 * @author fireway
 */
public class NativeExceptionHandling {
    public static void main(String[] args) {
        try {
            ExecutorService exec = Executors.newCachedThreadPool();
            exec.execute(new ExceptionThread());
            exec.shutdown();
        } catch(RuntimeException e) {
            System.out.println("RuntimeException has been handled!");
        }
    }
}
